﻿using System;
using personalplaner.business.dienstplan.plancollection;
using personalplaner.business.extensions;
using System.Windows.Media;
using personalplaner.business.enums;

namespace personalplaner.business.dienstplan
{
    public class PlanItem : ItemBase//, IDienstPlanItem
    {
		#region Properties


        int _prsId;
		public int PrsId
        {
            get { return _prsId; }
            set
            {
                _prsId = value;
                RaisePropertyChanged("PrsId");
            }
        }

        int _abteilungId;
        public int AbteilungId
        {
            get { return _abteilungId; }
            set
            {
                _abteilungId = value;
                RaisePropertyChanged("AbteilungId");
            }
        }
        
        DateTime _datum;
        public DateTime Datum
        {
            get { return _datum; }
            set
            {
                _datum = value;
                RaisePropertyChanged("Datum");
            }
        }

        int _dienstId;
        public int DienstId
        {
            get { return _dienstId; }
            set
            {
                _dienstId = value;
                RaisePropertyChanged("DienstId");
            }
        }

        double _stunden;
        public double Stunden
        {
            get { return _stunden; }
            set
            {
                _stunden = value;
                RaisePropertyChanged("Stunden");
            }
        }

        public int Argb
        {
            get {
                return Color.ToInt();
            }
            set
            {
                if (Color == null)
                    Color = value.ToColor();
            }
        }

        public string ColorString
        {
            get
            {
                return Color.ToArgbString();
            }
            set
            {
                if (Color == null)
                    Color = value.ToColor();
            }
        }

        Color? _color;
        public Color? Color
        {
            get { return _color; }
            set
            {
                _color = value;
                RaisePropertyChanged("Color");
            }
		}

		Color? _backgroundcolor;
		public Color? BackgroundColor
		{
			get { return _backgroundcolor; }
			set
			{
				_backgroundcolor = value;
				RaisePropertyChanged("BackgroundColor");
			}
		}

		bool _isHoliday;
		/// <summary>
		/// Gets or sets if the item is on a day that is a holiday
		/// </summary>
		public bool IsHoliday
		{
			get { return _isHoliday; }
			set
			{
				_isHoliday = value;
				RaisePropertyChanged("IsHoliday");
			}
		}

		bool _canexecutecommand = true;
    	public bool CanExecuteCommand
    	{
    		get
    		{
    			return _canexecutecommand;
    		}
    		set
    		{
    			_canexecutecommand = value;
    			RaisePropertyChanged("CanExecuteCommand");
    		}
		}

		enDienstType _dienstType;
    	public enDienstType DienstType
    	{
    		get
    		{
    			return _dienstType;
    		}
    		set
    		{
    			_dienstType = value;
    			RaisePropertyChanged("DienstType");
    		}
    	}

    	#endregion
	}
}
